package com.iss.card.view.store;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.iss.card.R;

public class StoreDetailFragment extends Fragment{

	private Activity mContext;
	
	private StoreDetailView mDetailView;
	private String mStoreId;
	private int mDefaultProductId;

	public StoreDetailFragment(String storeId, int defaultProductId){
		mStoreId = storeId;
		mDefaultProductId = defaultProductId;
	}

	public void backEvent(){
		//cancle loading.
		mDetailView.backEvent();
	}
	
	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		mContext = activity;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		
		FrameLayout layout = (FrameLayout) inflater.inflate(R.layout.frame_store_detail_view, null);
		mDetailView = new StoreDetailView(mContext, layout, mStoreId, mDefaultProductId);
		mDetailView.getStoreDetailInfo();
		return layout;
	}
}
